package com.blustreaksw.cyclecoach.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Helper class for providing content for user interfaces created by
 * Android template wizards.
 */
public class ItemListMap {

	/**
	 * An array of item labels.
	 */
	public static List<ItemLabel> ITEMS = new ArrayList<ItemLabel>();

	/**
	 * A map of items, by ID.
	 */
	public static Map<String, ItemLabel> ITEM_MAP = new HashMap<String, ItemLabel>();

	static {
		// Add 3 sample items.
		addItem(new ItemLabel("ProfileSettingsFragment", "Profile"));
		addItem(new ItemLabel("DeviceSettingsFragment", "Devices"));
		addItem(new ItemLabel("DataExportSettingsFragment", "Data Export"));
	}

	public static void addItem(ItemLabel item) {
		ITEMS.add(item);
		ITEM_MAP.put(item.id, item);
	}

	/**
	 * An item representing a piece of content.
	 */
	public static class ItemLabel {
		public String id;
		public String content;

		public ItemLabel(String id, String content) {
			this.id = id;
			this.content = content;
		}

		@Override
		public String toString() {
			return content;
		}
	}
}
